local opts = {
	noremap = true,
	silent = true
}

--------------
-- Markdown --
--------------
local markdown_group = vim.api.nvim_create_augroup('markdown', {clear = true})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',1', '#<Space><ESC>a', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',2', '##<Space><ESC>a', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',3', '###<Space><ESC>a', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',4', '####<Space><ESC>a', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',d', '``<Enter>``<Esc>ka<Enter>', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',c', '```<Enter>```<Esc>ka<Enter>', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',b', '****<Esc>hi', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',i', '**<Esc>i', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',s', '~~~~<Esc>hi', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',p', '![]()<Esc>i', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',a', '[]()<Esc>i', opts)
  end
})
vim.api.nvim_create_autocmd("FileType", {
  pattern = {"markdown"},
  group = 'markdown',
  callback = function()
    vim.keymap.set('i', ',n', '---<Enter><Esc>i', opts)
  end
})

-- --------------
-- --   Code   --
-- --------------
-- local file_type = {"*.c", "*.cpp", "*.cc", "*.h",    -- C/C++
--                    "*.v", "*.sv", "*.svh",           -- verilog/system-verilog
--                    "*.lua",                          -- Lua
--                    "*.scala", "*.sc",                -- scala
--                    "*.mk", "*Makefile", "*makefile", -- makefile
--                    "*.py",                           -- python
--                    "*.sh",                           -- bash
--                    "*.rs",                           -- rust
--                    "*.toml",                         -- toml
-- }
-- local code_group = vim.api.nvim_create_augroup('code', {clear = true})
-- vim.api.nvim_create_autocmd("BufEnter", {
--   pattern = file_type,
--   group = 'code',
--   callback = function()
--     vim.keymap.set('i', '(', '()<Esc>i', opts)
--   end
-- })
-- vim.api.nvim_create_autocmd("BufEnter", {
--   pattern = file_type,
--   group = 'code',
--   callback = function()
--     vim.keymap.set('i', '[', '[]<Esc>i', opts)
--   end
-- })
-- vim.api.nvim_create_autocmd("BufEnter", {
--   pattern = file_type,
--   group = 'code',
--   callback = function()
--     vim.keymap.set('i', '{', '{}<Esc>i', opts)
--   end
-- })
-- vim.api.nvim_create_autocmd("BufEnter", {
--   pattern = file_type,
--   group = 'code',
--   callback = function()
--     vim.keymap.set('i', '\'', '\'\'<Esc>i', opts)
--   end
-- })
-- vim.api.nvim_create_autocmd("BufEnter", {
--   pattern = file_type,
--   group = 'code',
--   callback = function()
--     vim.keymap.set('i', '\"', '\"\"<Esc>i', opts)
--   end
-- })
